<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
    <h1>今年天是个好日子，心想的事情都能成</h1>
    <span>
            <a th:if="${session.loginUser==null}" href="http://login.zkjshop.com:9000/view/login?target=http://www.zkjshop.com:9010/view/index">登录</a>
            <a th:unless="${session.loginUser==null}" href="http://www.zkjshop.com:9000/login/out" onclick="out()" >退出</a>

    </span>

    <p th:unless="${session.loginUser == null}">
        <span style="color: deepskyblue" th:text="${session.loginUser.userName}"></span>已登录
    </p>
</body>

<script>

    function out(){
        alert("退出成功请重新登录")
    }


</script>

</html>